# 代码所有：cxw
# 开发时间：2021/11/10 20:23

filename="text_file/learning knowledge.txt"
with open(filename) as files:
    comtenes=files.read()
    print(comtenes)

with open(filename) as f:
    for i in f:
        print(i.rstrip())
print("\n")

with open(filename) as f1:
    s=f1.readlines()
for i in s:
    print(i.strip())

with open(filename) as change:
    message=change.read()
    change_message=message.replace("python","c")
    #replace()方法并不能永久性的将字符串中的字符替换，原始的字符串不会被更改，要赋值一个新变量
    print(change_message)

